<!DOCTYPE HTML>
<html>
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
		<meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    	<title>统战成员学习平台</title>
	    <link rel="stylesheet" type="text/css" href="../../css/base.css" />
	    <link rel="stylesheet" type="text/css" href="../../css/discovery.css" />
	</head>
	<body>
		<div id='app' style="display:none" v-show="true">
<!--			<ul class="setting">-->
<!--				<li>仅WIFI下观看<div class="checkbox"><label for="aa"></label><input v-model="wifi" type="checkbox" id="aa"><div><span></span></div></div></li>-->
<!--				<li tapmode="tap" @click="clearCache()" class="ui_border_t">清除缓存<span style="float: right;">{{cacheSize | formatSize}}</span></li>-->
<!--				<li tapmode="tap" @click="openWin('resetPass_win')" class="ui_border_t right">修改密码</li>-->
<!--			</ul>-->
			<ul class="setting">
				<li tapmode="tap" @click="openWin('feedback_win')" class="right">意见反馈</li>
<!--				<li tapmode="tap" @click="openWin('about_win')" class="ui_border_t right">关于</li>-->
			</ul>
		</div>
		<script type="text/javascript" src="../../script/api.js"></script>
		<script type="text/javascript" src="../../script/vue.min.js"></script>
		<script type="text/javascript" src="../../script/common.js"></script>
		<script type="text/javascript" src="../../script/layer_mobile/layer.js"></script>
		<script type="text/javascript">
		    new Vue({
				el: '#app',
		     	data: {
					cacheSize: 0,
					wifi: false,
					apiready: false,
					isLogin: true
		     	},
				watch: {
					wifi: function() {
						var $this = this;
						$api.setStorage(_.WIFIONLY, $this.wifi);
					}
				},
				mounted: function() {
		        	var $this = this;
		        	apiready = function() {
						api.parseTapmode();
						$this.apiready = true;
						$this.init();
                	}
		    	},
		    	methods: {
					init: function() {
						var $this = this;
						$this.wifi = $api.getStorage(_.WIFIONLY) === 'true';
						api.getCacheSize(function(ret) {
						    $this.cacheSize = ret.size===-1?'无存储设备':ret.size===-2?'正在准备USB存储设备':ret.size===-3?'无法访问存储设备':ret.size;
						});
					},
					clearCache: function() {
						var $this = this;
						if(isNaN($this.cacheSize)) return;
						api.clearCache(function() {
							msgUtil.toast({msg: '清除完成'});
							$this.cacheSize = 0;
						});
					}
		    	}
		    });
		</script>
	</body>
</html>
